package com.angel.service.ServiceImpl;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import com.angel.bean.Template;
import com.angel.mapper.TemplateDao;
import com.angel.service.TemplateService;

@Service
public class TemplateServiceImpl implements TemplateService {

    @Resource
    private TemplateDao templateDao;

    @Override
    public int insert(Template template) {
        return templateDao.insert(template);
    }

    @Override
    public int insertSelective(Template template) {
        return templateDao.insertSelective(template);
    }

    @Override
    public int insertList(List<Template> templates) {
        return templateDao.insertList(templates);
    }

    @Override
    public int update(Template template) {
        return templateDao.update(template);
    }

    @Override
    public List<Template> findTemplate(Template template) {
        return templateDao.findTemplate(template);
    }

    @Override
    public List<Template> searchTemplate(Template template) {
        return templateDao.searchTemplate(template);
    }

    @Override
    public Template findOne(Template template) {
        List<Template> templates = templateDao.findTemplate(template);
        if (templates == null || templates.isEmpty()) {
            return null;
        }
        return templates.get(0);
    }

    @Override
    public int delTempolate(Integer id) {
        return templateDao.delTemplate(id);
    }


}
